using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace MJB.UI.ContentEditor.Windows
{
    /// <summary>
    /// Interaction logic for NewDocumentWindow.xaml
    /// </summary>
    public partial class NewDocumentWindow : Window
    {
        /// <summary>
        /// This is the new document name property.
        /// </summary>
        public static DependencyProperty NewDocumentNameProperty = DependencyProperty.Register("NewDocumentName",
            typeof(string),
            typeof(NewDocumentWindow),
            new PropertyMetadata(null));

        /// <summary>
        /// Creates the new document window.
        /// </summary>
        public NewDocumentWindow()
        {
            InitializeComponent();
            mNewDocumentTextBox.Focus();
        }

        /// <summary>
        /// Gets / sets the new document name.
        /// </summary>
        public string NewDocumentName
        {
            get
            {
                return (string)GetValue(NewDocumentNameProperty);
            }
            set
            {
                SetValue(NewDocumentNameProperty, value);
            }
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="args"></param>
        public void OnOKButtonClicked(object o, EventArgs args)
        {
            this.NewDocumentName = mNewDocumentTextBox.Text;
            this.Close();
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="args"></param>
        public void OnCancelButtonClicked(object o, EventArgs args)
        {
            this.NewDocumentName = null;
            this.Close();
        }

    }

}